3.159 \(\int x \sqrt {a-a \cos (x)} \, dx\)

Optimal. Leaf size=34 \[ 4 \sqrt {a-a \cos (x)}-2 x \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)} \]

[Out]

4*(a-a*cos(x))^(1/2)-2*x*cot(1/2*x)*(a-a*cos(x))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3319, 3296, 2637} \[ 4 \sqrt {a-a \cos (x)}-2 x \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)} \]

Antiderivative was successfully verified.

[In]

Int[x*Sqrt[a - a*Cos[x]],x]

[Out]

4*Sqrt[a - a*Cos[x]] - 2*x*Sqrt[a - a*Cos[x]]*Cot[x/2]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3319

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[((2*a)^IntPart[n
]*(a + b*Sin[e + f*x])^FracPart[n])/Sin[e/2 + (a*Pi)/(4*b) + (f*x)/2]^(2*FracPart[n]), Int[(c + d*x)^m*Sin[e/2
 + (a*Pi)/(4*b) + (f*x)/2]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[n
 + 1/2] && (GtQ[n, 0] || IGtQ[m, 0])

Rubi steps

\begin {align*} \int x \sqrt {a-a \cos (x)} \, dx &=\left (\sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x \sin \left (\frac {x}{2}\right ) \, dx\\ &=-2 x \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )+\left (2 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int \cos \left (\frac {x}{2}\right ) \, dx\\ &=4 \sqrt {a-a \cos (x)}-2 x \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 23, normalized size = 0.68 \[ -2 \left (x \cot \left (\frac {x}{2}\right )-2\right ) \sqrt {a-a \cos (x)} \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sqrt[a - a*Cos[x]],x]

[Out]

-2*Sqrt[a - a*Cos[x]]*(-2 + x*Cot[x/2])

________________________________________________________________________________________

fricas [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a-a*cos(x))^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

________________________________________________________________________________________

giac [A]  time = 0.42, size = 31, normalized size = 0.91 \[ -2 \, \sqrt {2} {\left (x \cos \left (\frac {1}{2} \, x\right ) \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) - 2 \, \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a-a*cos(x))^(1/2),x, algorithm="giac")

[Out]

-2*sqrt(2)*(x*cos(1/2*x)*sgn(sin(1/2*x)) - 2*sgn(sin(1/2*x))*sin(1/2*x))*sqrt(a)

________________________________________________________________________________________

maple [C]  time = 0.06, size = 54, normalized size = 1.59 \[ -\frac {i \sqrt {2}\, \sqrt {-a \left ({\mathrm e}^{i x}-1\right )^{2} {\mathrm e}^{-i x}}\, \left (2 i {\mathrm e}^{i x}+x \,{\mathrm e}^{i x}-2 i+x \right )}{{\mathrm e}^{i x}-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a-a*cos(x))^(1/2),x)

[Out]

-I*2^(1/2)*(-a*(exp(I*x)-1)^2*exp(-I*x))^(1/2)/(exp(I*x)-1)*(2*I*exp(I*x)+x*exp(I*x)-2*I+x)

________________________________________________________________________________________

maxima [B]  time = 1.69, size = 72, normalized size = 2.12 \[ {\left ({\left (\sqrt {2} x \sin \relax (x) + 2 \, \sqrt {2} \cos \relax (x) - 2 \, \sqrt {2}\right )} \cos \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \relax (x), \cos \relax (x)\right )\right ) - {\left (\sqrt {2} x \cos \relax (x) + \sqrt {2} x - 2 \, \sqrt {2} \sin \relax (x)\right )} \sin \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \relax (x), \cos \relax (x)\right )\right )\right )} \sqrt {a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a-a*cos(x))^(1/2),x, algorithm="maxima")

[Out]

((sqrt(2)*x*sin(x) + 2*sqrt(2)*cos(x) - 2*sqrt(2))*cos(1/2*pi + 1/2*arctan2(sin(x), cos(x))) - (sqrt(2)*x*cos(
x) + sqrt(2)*x - 2*sqrt(2)*sin(x))*sin(1/2*pi + 1/2*arctan2(sin(x), cos(x))))*sqrt(a)

________________________________________________________________________________________

mupad [B]  time = 0.32, size = 48, normalized size = 1.41 \[ -\frac {2\,\sqrt {a}\,\sqrt {1-\cos \relax (x)}\,\left (x+\cos \relax (x)\,2{}\mathrm {i}-2\,\sin \relax (x)+x\,\cos \relax (x)+x\,\sin \relax (x)\,1{}\mathrm {i}-2{}\mathrm {i}\right )}{\sin \relax (x)-\cos \relax (x)\,1{}\mathrm {i}+1{}\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a - a*cos(x))^(1/2),x)

[Out]

-(2*a^(1/2)*(1 - cos(x))^(1/2)*(x + cos(x)*2i - 2*sin(x) + x*cos(x) + x*sin(x)*1i - 2i))/(sin(x) - cos(x)*1i +
 1i)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x \sqrt {- a \left (\cos {\relax (x )} - 1\right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a-a*cos(x))**(1/2),x)

[Out]

Integral(x*sqrt(-a*(cos(x) - 1)), x)

________________________________________________________________________________________